import { getAuthDepartmentsFn } from '@/pages/commodity/modules/utils/salePriceRequireUtils';
import { PRODUCT_TYPES } from '../index';
const formItemList = [
  {
    prop: 'categoryPath',
    label: '分类',
    type: 'input'
  },
  {
    prop: 'spuNo',
    label: 'SPU编码',
    type: 'input'
  },
  {
    prop: 'productName',
    label: '商品名称',
    type: 'input'
  },
  {
    prop: 'brandName',
    label: '商品品牌',
    type: 'input'
  },
  {
    prop: 'productType',
    label: '商品类型',
    type: 'select',
    clearable: true,
    options: PRODUCT_TYPES
  },
  {
    prop: 'createOper',
    label: '创建人',
    type: 'userSelect',
    searchType: 'EQ'
  }
]
const tableColumns = [
  {
    title: '分类',
    key: 'categoryPath',
  },
  {
    title: 'SPU编码',
    key: 'spuNo'
  },
  {
    title: '商品名称',
    key: 'productName'
  },
  {
    title: '品牌',
    key: 'brandName'
  },
  {
    title: '创建人',
    key: 'createOperName'
  },
  {
    title: '创建人部门',
    key: 'createOperDeptName'
  },
  {
    title: '商品类型',
    key: 'productTypeStr'
  },
  {
    title: '归属部门',
    align: 'center',
    render: (h, { row }) => {
      return h('span', getAuthDepartmentsFn(row));
    }
  },
  {
    title: '管理区域',
    key: 'manageAreaName'
  },
  {
    title: '销售属性',
    key: 'saleAttrInfo'
  },
  {
    title: '创建日期',
    key: 'createOpeTime',
    width: 180
  },
]
export {
  formItemList,
  tableColumns
}
